package com.xw.demo.mybatis.controller;

import com.xw.demo.mybatis.entity.UserTest;
import com.xw.demo.mybatis.service.UserTestService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author xiongwei_vendor
 * @date 2021/12/30 17:37
 */
@RestController
@RequestMapping("/user-test")
public class UserTestController {

    @Autowired
    private UserTestService userTestService;

    @GetMapping("/findUserList")
    @ApiOperation(value = "获取列表", notes = "列表信息")
    public List<UserTest> getUserTestList() {
        return userTestService.findUserTestList();
    }

    @GetMapping("/getUserTestById/{id}")
    @ApiOperation(value = "获取信息", notes = "版本信息")
    public UserTest getUserTestById(@ApiParam(value = "id", required = true) @PathVariable("id") String id) {
        return userTestService.getUserTestById(id);
    }

    @PostMapping("/createUserTest")
    @ApiOperation(value = "创建人物信息", notes = "创建信息", httpMethod = "POST")
    public boolean insertUserTest(@ApiParam(value = "参数信息", required = true) @RequestBody UserTest userTest) {
        return userTestService.insertUserTest(userTest);
    }

}
